package com.tianqu.tms.entity;

import com.tianqu.tms.core.base.TmsEntity;
import com.tianqu.tms.core.exception.TmsDaoException;
import com.tianqu.tms.core.exception.TmsException;
import com.tianqu.tms.dao.TmsDao;
import com.tianqu.tms.dao.TmsSmsInfoDao;
import com.tianqu.tms.dto.TmsSmsInfoDto;

public class TmsSmsInfo extends TmsEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1930132787766609069L;

	private int id;
	private String serial;
	private String ownerPhone;
	private String smsContent;
	private int insertUserId;
	private String insertTime;
	private int pepType;
	private int sendFrom;
	
	
	public static TmsSmsInfo getInstance() {
		TmsSmsInfo his = new TmsSmsInfo();
		his.setExisting(false);
		return his;
	}
	
	/**
	 * 评估插入一条历史记录
	 * 
	 * @return
	 * @throws TmsDaoException 
	 */
	public void insertSmsInfo(TmsSmsInfo entity) throws TmsDaoException
	{
		TmsSmsInfoDao uDao = (TmsSmsInfoDao) TmsDao.getInstance(TmsDao.TMS_SMS_INFO);
	
		TmsSmsInfoDto dto  = new TmsSmsInfoDto();
		dto.setSerial(entity.getSerial());
		dto.setOwnerPhone(entity.getOwnerPhone());
		dto.setSmsContent(entity.getSmsContent());
		dto.setInsertUserId(entity.getInsertUserId());
		dto.setPepType(entity.getPepType());
		dto.setSendFrom(entity.getSendFrom());
		uDao.insertinsertSmsInfo(dto);
	}
	

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getSerial() {
		return serial;
	}

	public void setSerial(String serial) {
		this.serial = serial;
	}

	public String getOwnerPhone() {
		return ownerPhone;
	}

	public void setOwnerPhone(String ownerPhone) {
		this.ownerPhone = ownerPhone;
	}

	public String getSmsContent() {
		return smsContent;
	}

	public void setSmsContent(String smsContent) {
		this.smsContent = smsContent;
	}

	public int getInsertUserId() {
		return insertUserId;
	}

	public void setInsertUserId(int insertUserId) {
		this.insertUserId = insertUserId;
	}

	public String getInsertTime() {
		return insertTime;
	}

	public void setInsertTime(String insertTime) {
		this.insertTime = insertTime;
	}

	public int getPepType() {
		return pepType;
	}

	public void setPepType(int pepType) {
		this.pepType = pepType;
	}

	public int getSendFrom() {
		return sendFrom;
	}

	public void setSendFrom(int sendFrom) {
		this.sendFrom = sendFrom;
	}

	@Override
	public void save() throws TmsDaoException, TmsException {
		// TODO Auto-generated method stub

	}

}
